import 'package:flutter/material.dart';

class ImageView extends StatefulWidget {
  const ImageView({super.key});

  @override
  State<ImageView> createState() => _ImageViewState();
}

/**
 * fit: 图片填充方式(BoxFit枚举)

    BoxFit.fill: 完全填充，可能变形

    BoxFit.contain: 保持宽高比，完整显示

    BoxFit.cover: 保持宽高比，填满容器，可能裁剪

    BoxFit.fitWidth: 适应宽度

    BoxFit.fitHeight: 适应高度

    BoxFit.scaleDown: 仅在需要时缩小图片
 *
 * */
class _ImageViewState extends State<ImageView> {
  String URL = "http://gips2.baidu.com/it/u=195724436,3554684702&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960";
  @override
  Widget build(BuildContext context) {
    return Scaffold(body: Center(child: Wrap(
      children: [
        Image.network(URL,width: 100,height: 100,fit: BoxFit.cover,),
        ClipOval(
          child: Image.network(
            URL,
            width: 100,
            height: 100,
            fit: BoxFit.cover,
          ),
        ),
        Image.asset("assets/images/ic_reward.png",width: 100,height: 100,)
      ]
    ),),);
  }
}
